﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Ultilities;
using DevExpress.XtraBars.Helpers;

namespace SalonManager
{
    public partial class FrmChangeUserStyle : BaseForm
    {
        public FrmChangeUserStyle()
        {
            InitializeComponent();

            this.Load += FrmChangeUserStyle_Load;
            galleryControl.Gallery.ItemCheckedChanged += Gallery_ItemCheckedChanged;
            galleryControl.Gallery.ItemClick += Gallery_ItemClick;
        }

        void Gallery_ItemClick(object sender, DevExpress.XtraBars.Ribbon.GalleryItemClickEventArgs e)
        {
            try
            {
                string curSkinName = e.Item.Caption;
                Properties.Settings.Default.SkinStyle = curSkinName;
                Properties.Settings.Default.Save();
            }
            catch (Exception ex)
            {
                Globals.ShowMessageBox(ex.Message, this.Text);
            }
        }

        void Gallery_ItemCheckedChanged(object sender, DevExpress.XtraBars.Ribbon.GalleryItemEventArgs e)
        {
            //try
            //{
            //    string curSkinName = e.Item.Caption;
            //    Properties.Settings.Default.SkinStyle = curSkinName;
            //    Properties.Settings.Default.Save();
            //}
            //catch (Exception ex)
            //{
            //    Globals.ShowMessageBox(ex.Message, this.Text);
            //}
        }

        void FrmChangeUserStyle_Load(object sender, EventArgs e)
        {
            SkinHelper.InitSkinGallery(galleryControl, true);            
        }
    }
}
